<!-- Modal -->
<div class="modal fade " id="addEasyLinkModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document" style="width: 40%">
        <div class="box box-info">
            <div class="box-header with-border">
                <h3 class="box-title">机构通讯录</h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form class="form-horizontal">
                <div class="box-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">类型</label>
                        <div class="col-sm-3">
                            <select  class="form-control select2"  id="addEasyLinkModal_isSetting" style="width: 100%;" onchange="changeSetting()">
                                <option value="1">已配置</option>
                                <option value="2">自定义</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group" id="trueSetting">
                        <label class="col-sm-2 control-label">供应系统</label>
                        <div class="col-sm-3">
                            <select  class="form-control select2"  style="width: 100%;" >
                                <option>供应商系统</option>
                                <option>信息化平台</option>
                            </select>
                        </div>
                        <label class="col-sm-2 control-label">具体链接</label>
                        <div class="col-sm-4">
                            <select  class="form-control select2"  style="width: 100%;" >
                                <option>禅道</option>
                                <option>恒生风控系统</option>
                                <option>公司网站</option>
                                <option>项目投资管理系统</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group" style="display: none" id="falseSetting">
                        <label for="inputEmail3" class="col-sm-2 control-label pull-left">链接名称</label>
                        <div class="col-sm-3">
                            <input id="addContactModal_mobilePhone" type="text" class="form-control" >
                        </div>
                        <label for="inputEmail3" class="col-sm-2 control-label pull-left">链接地址</label>
                        <div class="col-sm-4">
                            <input id="addContactModal_telePhone" type="text" class="form-control" >
                        </div>
                    </div>

                    <!-- /.box-body -->
                    <div class="box-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button id="btnSubmit" type="button" class="btn btn-primary pull-right" onclick="developing()">保存
                        </button>
                    </div>
                    <!-- /.box-footer -->
            </form>
        </div>
    </div>
</div>

<script>


    function addEasyLinkModal_Init() {
        $("#addEasyLinkModal_custName").val("");

    }

    function addContactModal_SetValue(index) {
//        $("#windCodeDiv").css("display","none");
//        $("#changeEnterTypeBtn").css("display","none");
//        $("#addContactModal_custName").attr("disabled","disabled") ;
        var options = $("#institutionbaseinfoTable").bootstrapTable("getData");
        var row = options[index];
        $("#addContactModal_custName").val(row.custName);
//        var url = "/scorebasicdata/cust/info?issuerId=" + row.id;
//        getReq(url,function (result) {
//            if(result.length != 0) {
//                var data = result[0] ;
//                $("#addContactModal_custId").val(data.id);
//                $("#addContactModal_custName").val(data.custName);
//                $("input[name='addContactModal_isCityInvest'][value='" + data.isCityInvest + "']").attr("checked", 'true');
//                $("#addContactModal_externalEnvironment").val(data.externalEnvironment);
//                $("#addContactModal_businessOperation").val(data.businessOperation);
//                $("#addContactModal_financialPerformance").val(data.financialPerformance);
//            }
//        });

    }
    function changeSetting() {
        var isSetting = $("#addEasyLinkModal_isSetting").val();
        if("1" == isSetting) {
            $("#trueSetting").css("display","block") ;
            $("#falseSetting").css("display","none") ;
        } else   if("2" == isSetting) {
            $("#trueSetting").css("display","none") ;
            $("#falseSetting").css("display","block") ;
        } else  {
            $("#trueSetting").css("display","block") ;
            $("#falseSetting").css("display","none") ;
        }
    }

    function addEasyLinkModal_save() {
        toastr['success']('操作成功', '提示');
        $("#table1").bootstrapTable("refresh");
        $("#addEasyLinkModal").modal("hide");
//        var data = {
//            id: $("#addContactModal_custId").val(),
//            custName: $("#addContactModal_custName").val(),
//            windCode: $("#addContactModal_windCode").val(),
//            isCityInvest: $("input[name=addContactModal_isCityInvest]:checked").val(),
//            externalEnvironment: $("#addContactModal_externalEnvironment").val(),
//            businessOperation: $("#addContactModal_businessOperation").val(),
//            financialPerformance: $("#addContactModal_financialPerformance").val()
//        };
//        var url = "/scorebasicdata/cust/save";
//        postReq(url, data, function (result) {
//            if (result.success) {
//
//            } else {
//                toastr['error'](result.msg, '提示');
//            }
//        });
    }
</script>
